﻿using Karma.Framework.Core.Domain.Tools.Import.Data;
using Karma.Framework.Core.Domain.Tools.Import.Layout;
using Karma.Framework.Core.Domain.Tools.Import.Providers;
using Karma.Framework.Core.Domain.Tools.Import.Validation;
using Ninject.Core;

namespace Karma.Framework.Core.Domain.Tools.Import
{
    public class ImporterModule: StandardModule
    {
        public override void Load()
        {
            Bind<ILayoutFactory>().To<DefaultLayoutFactory>();
            Bind<ILayoutFileReader>().To<ExcelLayoutFileReader>();
            Bind<ILayoutFileBuilder>().To<ExcelLayoutFileBuilder>();

            Bind<ILayoutValidator>().To<ExcelLayoutValidator>();
            Bind<IDataValidator>().To<DefaultDataValidator>();
            Bind<IReferenceValidator>().To<DefaultReferenceValidator>();
            Bind<IUniqueKeyValidator>().To<DefaultUniqueKeyValidator>();

            Bind<IEntityPersister>().ToProvider<EntityPersisterProvider>();

            Bind<IImporterService>().To<DefaultImporterService>();
        }
    }
}
